﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
namespace TestEnvirementCL.POCO
{
  public class Meeting
  {
    //Attributes of the Table
    public int MeetingId { get; set; }
    public string Name { get; set; }
    public string Location { get; set; }
    public Boolean Type { get; set; }
    public DateTime Date { get; set; }
    
    //Foreign Keys
    public int? NSSFId { get; set; }
    public int? CoachId { get; set; }

    //Relations to other Classes
    public virtual NSSF NSSF { get; set; }
    public virtual Coach Coach { get; set; }
    public virtual List<Event> Events { get; set; }
    public virtual List<Team> Teams { get; set; }
    //public virtual List<Result> Results { get; set; }
    public virtual List<Record> Records { get; set; }


    public int? getForeignKeyId(object primaryClass) {
      if (primaryClass.GetType() == Coach.GetType())
      {
        return CoachId;
      }
      else
      {
        return NSSFId;
      }
    }
    public int getId() {
      return MeetingId;
    }
  }
}
